﻿#pragma once

#include <QObject>
#include "qcustomplot.h"
#include <memory>
#include "MetricesData.h"
#include "MarketDataBase.h"

// 指标绘制
class MetricesPainter : public QObject
{
	Q_OBJECT

public:
	MetricesPainter(QObject *parent, QCustomPlot *plot, const std::deque<MData::KLineItem> &kItems);
	~MetricesPainter();

	// 绘制所有的指标
	void DrawMetrices(const std::map<std::string, std::shared_ptr<MetData::MetriceBase>> &pMetrics);
private:
	// 绘制均线
	void drawMA(std::shared_ptr<MetData::MetriceBase> pMetrice);
	// 绘制MACD
	void drawMACD(std::shared_ptr<MetData::MetriceBase> pMetrice);
	// 绘制波浪线
	void drawWave(std::shared_ptr<MetData::MetriceBase> pMetrice);
	// 绘制黄金分割线
	void drawGoldLine(std::shared_ptr<MetData::MetriceBase> pMetrice);

	QCustomPlot *m_plot;
	const std::deque<MData::KLineItem> &m_kItems;
};
